<template>
  <el-container style="height: 100vh">
    <el-aside width="200px">
      <el-menu
              router
              default-active="/"
              class="el-menu-vertical-demo"
      >
        <el-menu-item index="/">
          <i class="el-icon-menu"></i>
          <span slot="title">首页</span>
        </el-menu-item>
        <el-menu-item index="/videoUpload">
          <i class="el-icon-document"></i>
          <span slot="title">关于</span>
        </el-menu-item>
      </el-menu>
    </el-aside>

    <el-container>
      <el-header style="border-bottom: 1px solid #eee">
        <div style="float: right">
          <el-button type="text" @click="logout">退出登录</el-button>
        </div>
      </el-header>

      <el-main>
        <router-view/>
      </el-main>
    </el-container>
  </el-container>
</template>

<script>
  import {
    get
  } from '@/api/test'
  export default {
    created() {
      get()
    },
    methods: {
      logout() {
        localStorage.removeItem('token')
        this.$router.push('/login')
      }
    }
  }
</script>
